<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
<div ng-app="myApp" ng-controller="myCtrl">
    <p>名：<input type="text" ng-model="firstName"></p>
    <p>姓：<input type="text" ng-model="lastName"></p>
    <span>姓名为：{{firstName+" "+lastName}}</span>
</div>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
    var app = angular.module('myApp', []);
    app.controller('myCtrl', function($scope) {
        $scope.firstName= "John";
        $scope.lastName= "Doe";
    });
</script>

</body>
</html>